Learn how the indexing queue works in Algolia extension for Magento 2.
algoliasearch_queue
.
After turning on the indexing queue in Magento, you need to set up processing the queue.
By default, the queue runs up to 5 operations at the same time.
Depending on the available resources on your server, you can adjust this number
by changing the Number of jobs to run each time the cron is run setting.
To keep your data synchronized between Magento and Algolia,
the indexing queue needs to finish processing between cron
intervals.
To find out how many operations the server can handle, you can try the following (this example assumes that the indexing queue runs every 5 minutes):
crontab
entry:
PROCESS_FULL_QUEUE=1
to the command:
algoliasearch_queue
table in your database.
If you clear your indexing queue, you should perform a full reindexing so that your Algolia indices have up-to-date data.
algoliasearch_queue_log
in your database.
Each row represents one process of the algolia_queue_runner
indexer, whether from the cron job or a manual run.
The duration
column shows the time in seconds needed to process the indexing queue.
To account for extra processing time and server load variations,
the duration should be at least one minute shorter than your cron job interval.
For example, if you set the cron interval to 5 minutes (300 seconds),
the duration of the indexing jobs should be less than 240 seconds (4 minutes).
If you’re performing well under the recommended duration, you can increase the number of processed jobs to optimize your queue runner. You can find this setting in Stores > Configuration > Algolia Search > Indexing queue / Cron > Number of jobs to run each time the cron is run.
Likewise, if you’re performing over the recommended time, you should reduce the number of processed jobs.
To see the indexing queue logs, go to Stores > Algolia Search > Indexing Queue > See Run Logs in the Magento dashboard.
Update on Save
. When an entity updates, Magento indexes the saved event’s data.Update on Schedule
. Magento bypasses these events by creating MySQL table triggers to store updated entity IDs in a change log *_cl
table.Update on Schedule
:
Indexer name | Indexer ID |
---|---|
Algolia Search Products | algolia_products |
Algolia Search Categories | algolia_categories |
Algolia Search Pages | algolia_pages |
algolia_queue_runner
indexer to Update on Schedule
isn’t recommended. In combination with the recommended cron, changing this mode to Update on Schedule
can cause strange indexing behavior including data loss from concurrent job processing. For better performance, keep this indexer set to Update on Save
.